package test;

import org.jing.core.logger.JingLogger;
import org.jing.core.socket.BaseSocketServer;
import org.jing.core.socket.BaseSocketServerMenu;
import org.jing.core.socket.SocketConfiguration;

import java.io.InputStream;
import java.io.OutputStream;

/**
 * Description: <br>
 *
 * @author bks <br>
 * @since 2020-12-30 <br>
 */
public class Demo4Socket {
    private Demo4Socket() {
        SocketMenu socketMenu = new SocketMenu();
        SocketConfiguration configuration = new SocketConfiguration();
        configuration.setPort(18999);
        configuration.setPermits(12);
        socketMenu.setConfig(configuration);
        // ThreadPool.create(socketMenu);
    }

    static class SocketMenu extends BaseSocketServerMenu<SocketServer> {
    }

    protected static class SocketServer extends BaseSocketServer {
        private static final JingLogger LOGGER = JingLogger.getLogger(SocketServer.class);

        @Override protected void operation(InputStream reader, OutputStream writer) {
            LOGGER.debug("operation");
        }
    }

    public static void main(String[] args) {
        new Demo4Socket();
    }
}
